package org.dromara.study.domain.vo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.dromara.study.domain.entity.Department;

import java.util.List;

@Data
@EqualsAndHashCode(callSuper = false)
public class DepartmentTreeVo extends Department {
    private List<DepartmentTreeVo> children;

    // 构造函数：用于将 Department 转换为 DepartmentTreeVo
    public DepartmentTreeVo(Department department) {
        // 调用父类的 setter 方法设置属性
        this.setId(department.getId());
        this.setName(department.getName());
        this.setDescription(department.getDescription());
        this.setParentId(department.getParentId());
    }
}
